package exportword.test;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;

import javax.media.jai.JAI;
import javax.media.jai.RenderedOp;

public class tiff2Gif {
	public static void main(String[] args) throws FileNotFoundException {
		 /* tif转换到jpg格式 */  
		String inputFile = "I://20180721180103.tif";
		String outputFile = "E://Rb.jpeg";

		// Load the input image.
		RenderedOp src = JAI.create("fileload", inputFile);

		// Encode the file as a JPEG image.
		FileOutputStream stream = new FileOutputStream(outputFile);
		JAI.create("encode", src, stream, "JPEG", null);

		// Store the image in the BMP format.
		JAI.create("filestore", src, outputFile,"JPEG", null);
	}
}
